/**
 * 
 */

/**
 * @author hnikoue
 *
 */
public class gateArrivalInfo {
	private LocalArrTime firstArrivalTime=null;
	private LocalArrTime lastDepartureTime=null;
	private int nbPAX=0;
	private double ratePAX;
	public gateArrivalInfo(LocalArrTime t1){
		firstArrivalTime = t1;
		lastDepartureTime = t1;
		nbPAX++;
	}
	
	public void updateTime(LocalArrTime tend){
		lastDepartureTime = tend;
		nbPAX++;
	}
	
	public double returnRate(){
		double tdiff;
		tdiff = getTimedifference();
		if(Math.abs(tdiff)<0.00001){
			ratePAX = 0.0;
		}else{
			ratePAX = 3600*nbPAX/(tdiff);
		}
		return ratePAX;
	}

	private double getTimedifference() {
		return lastDepartureTime.timeDiff(firstArrivalTime);
	}
	



}
